<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="shortcut icon" href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/img/logo.png"/>
	<title>退款详情</title>
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/css/mui.min.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/all.css" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/other/app.css?v=1" rel="stylesheet" />
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/font/iconfont.css" rel="stylesheet" />
	<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/js/mui.min.js"></script>
</head>
<style type="text/css">
	.refund-details .refund-application .title{height: 40px;line-height: 40px;}
	.refund-details .refund-application .refund{padding: 5px 10px}
	.commodity_details:nth-of-type(1){padding-top: 5px;}
	.commodity_details:nth-last-of-type(2){padding-bottom: 5px}
	.commodity_details{background:#fafafa;}
	.refund-details .refund-application ul li{height: 35px;line-height: 35px;}
	.refund-details .refund-application ul{height: 45px}
</style>
<body>
<div class="refund-details">
	<header>
		<p>{{if eq .info.agree "0"}}
			等待您的回复
			{{else if eq .info.agree "1"}}
			{{if eq .info.check "0"}}
			等待您检查货物
			{{else if eq .info.check "1"}}
			{{if eq .info.return "0"}}
			等待您打款
			{{else}}
			退货订单已处理
			{{end}}
			{{else if eq .info.check "2"}}
			货物检查不合格
			{{end}}
			{{else}}
			您不同意退款
			{{end}}</p>
	</header>
	<div class="state">
		<h1>客户发起退款申请，请及时处理</h1>
		<div>
			<p><span>•</span>商家同意后，您可以退款给客户,如果是已经到货的请等待对方返还货物。</p>
			<p><span>•</span>如果您拒绝，客户可以修改退款申请后再次发起，您需要重新处理。</p>
			<ol>
				{{if eq .info.agree "0"}}
				<span class="status" data-type="agree" data-status="1" data-id={{.info.id}}>同意申请</span>
				<span class="status" data-type="agree" data-status="2" data-id={{.info.id}}>不同意申请</span>
				{{else if eq .info.agree "1"}}
					{{if eq .info.return "0"}}
						{{if eq .info.type "0"}}
							{{if eq .info.check "0"}}
							<span class="status" data-type="check" data-status="1" data-id={{.info.id}}>检查通过</span>
							<span class="status" data-type="check" data-status="2" data-id={{.info.id}}>检查不通过</span>
							{{else if eq .info.check "1"}}
							<span id="pay" data-id={{.info.id}}>打款</span>
							{{end}}
						{{else}}
							{{if eq .info.check "0"}}
							<span class="status" data-type="check" data-status="1" data-id={{.info.id}}>检查通过</span>
							<span class="status" data-type="check" data-status="2" data-id={{.info.id}}>检查不通过</span>
							{{end}}
						{{end}}
					{{end}}
				{{end}}
			</ol>
		</div>
	</div>
	<div class="refund-application">
		<h1 class="title">退款信息</h1>
		{{range .info.product}}
<!-- 		<a href="/mobile/column/product_content?id={{.id}}">
		<div class="refund">
			<img src="{{.pathname}}">
			<p class="overpl3 fr">{{.title}}</p>
		</div>
		</a>
 -->
		<div class="commodity_details">
			<div class="commodity">
				<a class="one" href="/mobile/column/product_content?id={{.id}}">
					<div>
						<img src="{{.pathname}}">
						<div>
							<p>{{.title}}</p>
							<p>
								规格 : {{.number}}{{.spec}}/箱<br>
								型号 : {{.model}}<br>
							</p>
							<p class="bfd">￥ {{.price}}<span class="fr">x{{.num}}{{if eq .spec2 "1"}}件{{else}}箱{{end}}</span></p>
						</div>
					</div>
				</a>
			</div>
		</div>
		{{end}}



		<div class="sm">
			<p>退款类型：{{if eq .info.type "0"}}退货{{else}}换货{{end}}</p>
			<p>退款原因：{{.info.whys}}</p>
			<p>应款金额：￥{{.info.money}}</p>
			{{if .info.returnmoney}}
			{{if ne .info.returnmoney "0.00"}}
			<p>退款金额：￥{{.info.returnmoney}}</p>
			{{end}}
			{{end}}
			<p>退款时间：{{.info.addtime}}</p>
			<p>退款编号：{{.info.ordernum}}</p>
			{{if .info.intr}}
			{{if ne .info.intr ""}}
			<p>退款说明：{{.info.intr}}</p>
			{{end}}
			{{end}}
			{{if .info.checkresult}}
			{{if ne .info.checkresult ""}}
			<p>检查结果：{{.info.checkresult}}</p>
			{{end}}
			{{end}}
			{{if .info.result}}
			{{if ne .info.result ""}}
			<p>调查结果：{{.info.result}}</p>
			{{end}}
			{{end}}
			{{if .info.returntime}}
			{{if ne .info.returntime ""}}
			<p>退款时间：{{.info.returntime}}</p>
			{{end}}
			{{end}}
		</div>
		<ul>
			<li><a href="/mobile/my/message_content?id={{.info.uid}}"><span class="mui-icon iconfont">&#xe805;</span>联系买家</a></li>
			<li><a href="tel:{{.info.mobile}}"><span class="mui-icon iconfont">&#xe79a;</span>拨打电话</a></li>
		</ul>
	</div>
</div>
</body>
{{template "wechat/public/share.html" .}}
<script>
	document.getElementById("pay").addEventListener('tap',function(){
		mui.prompt("订单价格为&yen;{{.info.money}},请输入返还金额!","提示",function(res){
			console.log(res)
			if(res.index){
				mui.ajax("/mobile/my/shop_order_return_pay",{
					data:{money:res.value,id:id},
					type:'post',
					success:function(res){
						if(res==1){
							history.go(0)
						}else if(res==0){	
							mui.toast("网络繁忙,请稍后再试~")
						}else if(res==1){
							mui.confirm("余额不足,是否前往充值?","提示",function(data){
								if(data.index){
									window.location.href="/mobile/my/money/recharge"
								}
							})
						}
					}
				})
			}
		})
		document.querySelector('.mui-popup-input input').type='tel' 
	})
	mui('body').on('tap','.status',function(){
		var type=this.getAttribute("data-type")
		var id=this.getAttribute("data-id")
		var status=this.getAttribute("data-status")
		mui.confirm("您确定要这么做吗?","提示",function(res){
			if(res.index){		
				mui.ajax(window.location.href,{
					data:{type:type,id:id,status:status},
					type:'post',
					success:function(res){
						console.log(res)
						if(res){
							history.go(0)
						}else{	
							mui.toast("网络繁忙,请稍后再试~")
						}
					}
				})
			}
		})
	})
</script>
</html>
